package thread;

import java.util.*;

public class AAA {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s1=sc.next();
        String s2=sc.next();
        Map<Character,Integer> map1=new HashMap<>();
        Map<Character,Integer> map2=new HashMap<>();
        int z=0;
        int c=0;
        for(int i=0;i<s1.length();i++){
            if(s1.charAt(i)==s2.charAt(i))++z;
            else {
                map1.put(s1.charAt(i),map1.getOrDefault(s1.charAt(i),0)+1);
                map2.put(s2.charAt(i),map2.getOrDefault(s2.charAt(i),0)+1);
            }
        }
        for (char t:map1.keySet()) {
            if(map2.containsKey(t))
                c+=Math.min(map1.get(t),map2.get(t));
        }
        System.out.println(z+"Z"+c+"C");
    }

}
